🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / ui / src / commonMain / kotlin / org / meshtastic / core / ui / component / MainAppBar.kt
Displaying Raw • Download
core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/MainAppBar.kt ea85b906e86c00261ec91f9ad7cf4a601417d135 (ea85b906) Text, 5.50 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.ui.component
Tff7b72import T7ee787androidx.compose.animation.AnimatedVisibility
Tff7b72import T7ee787androidx.compose.animation.fadeIn
Tff7b72import T7ee787androidx.compose.animation.fadeOut
Tff7b72import T7ee787androidx.compose.foundation.Image
Tff7b72import T7ee787androidx.compose.foundation.clickable
Tff7b72import T7ee787androidx.compose.foundation.layout.padding
Tff7b72import T7ee787androidx.compose.foundation.layout.size
Tff7b72import T7ee787androidx.compose.foundation.shape.CircleShape
Tff7b72import T7ee787androidx.compose.material3.ExperimentalMaterial3Api
Tff7b72import T7ee787androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
Tff7b72import T7ee787androidx.compose.material3.Icon
Tff7b72import T7ee787androidx.compose.material3.IconButton
Tff7b72import T7ee787androidx.compose.material3.MaterialTheme
Tff7b72import T7ee787androidx.compose.material3.Text
Tff7b72import T7ee787androidx.compose.material3.TopAppBar
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.rememberCoroutineScope
Tff7b72import T7ee787androidx.compose.ui.Modifier
Tff7b72import T7ee787androidx.compose.ui.draw.clip
Tff7b72import T7ee787androidx.compose.ui.layout.ContentScale
Tff7b72import T7ee787androidx.compose.ui.semantics.Role
Tff7b72import T7ee787androidx.compose.ui.text.style.TextOverflow
Tff7b72import T7ee787androidx.compose.ui.unit.dp
Tff7b72import T7ee787kotlinx.coroutines.launch
Tff7b72import T7ee787org.jetbrains.compose.resources.getString
Tff7b72import T7ee787org.jetbrains.compose.resources.painterResource
Tff7b72import T7ee787org.jetbrains.compose.resources.stringResource
Tff7b72import T7ee787org.jetbrains.compose.resources.vectorResource
Tff7b72import T7ee787org.koin.compose.koinInject
Tff7b72import T7ee787org.meshtastic.core.model.Node
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.ic_meshtastic
Tff7b72import T7ee787org.meshtastic.core.resources.navigate_back
Tff7b72import T7ee787org.meshtastic.core.ui.icon.ArrowBack
Tff7b72import T7ee787org.meshtastic.core.ui.icon.MeshtasticIcons
Tff7b72import T7ee787org.meshtastic.core.ui.util.LocalEventBranding
Tff7b72import T7ee787org.meshtastic.core.ui.util.SnackbarManager
Tf0883e@OptInTb4b4b4(Te6edf3ExperimentalMaterial3ExpressiveApiTff7b72::Te6edf3classTb4b4b4, Te6edf3ExperimentalMaterial3ApiTff7b72::Te6edf3classTb4b4b4)
Tf0883e@Composable
Tff7b72fun Td2a8ffMainAppBarTb4b4b4(
Te6edf3modifierTb4b4b4: Te6edf3Modifier Tff7b72= Te6edf3ModifierTb4b4b4,
Te6edf3titleTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3subtitleTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4,
Te6edf3ourNodeTb4b4b4: Te6edf3Node?Tb4b4b4,
Te6edf3showNodeChipTb4b4b4: Tffa657BooleanTb4b4b4,
Te6edf3canNavigateUpTb4b4b4: Tffa657BooleanTb4b4b4,
Te6edf3onNavigateUpTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3actionsTb4b4b4: Tf0883e@Composable Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3onClickChipTb4b4b4: Tb4b4b4(Te6edf3NodeTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3brandingContentTb4b4b4: Tf0883e@Composable Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657Unit Tff7b72= Tb4b4b4{ Te6edf3EventAwareBrandingTb4b4b4(Tb4b4b4) Tb4b4b4}Tb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3TopAppBarTb4b4b4(
Te6edf3title Tff7b72= Tb4b4b4{
Te6edf3TextTb4b4b4(
Te6edf3text Tff7b72= Te6edf3titleTb4b4b4,
Te6edf3maxLines Tff7b72= T79c0ff1Tb4b4b4,
Te6edf3overflow Tff7b72= Te6edf3TextOverflowTb4b4b4.Te6edf3EllipsisTb4b4b4,
Te6edf3style Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3typographyTb4b4b4.Te6edf3titleLargeEmphasizedTb4b4b4,
Tb4b4b4)
Tb4b4b4}Tb4b4b4,
Te6edf3subtitle Tff7b72= Tb4b4b4{
Te6edf3subtitleTff7b72?.Te6edf3let Tb4b4b4{
Te6edf3TextTb4b4b4(
Te6edf3text Tff7b72= Tffa657itTb4b4b4,
Te6edf3maxLines Tff7b72= T79c0ff1Tb4b4b4,
Te6edf3overflow Tff7b72= Te6edf3TextOverflowTb4b4b4.Te6edf3EllipsisTb4b4b4,
Te6edf3style Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3typographyTb4b4b4.Te6edf3titleSmallTb4b4b4,
Te6edf3color Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3colorSchemeTb4b4b4.Te6edf3onSurfaceVariantTb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}Tb4b4b4,
Te6edf3modifier Tff7b72= Te6edf3modifierTb4b4b4,
Tff7b72if Tb4b4b4(Te6edf3canNavigateUpTb4b4b4) Tb4b4b4{
Tb4b4b4{
Te6edf3IconButtonTb4b4b4(Te6edf3onClick Tff7b72= Te6edf3onNavigateUpTb4b4b4) Tb4b4b4{
Te6edf3IconTb4b4b4(
Te6edf3imageVector Tff7b72= Te6edf3MeshtasticIconsTb4b4b4.Te6edf3ArrowBackTb4b4b4,
Te6edf3contentDescription Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3navigate_backTb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4} Tff7b72else Tb4b4b4{
Tb4b4b4{ Te6edf3brandingContentTb4b4b4(Tb4b4b4) Tb4b4b4}
Tb4b4b4}Tb4b4b4,
Te6edf3actions Tff7b72= Tb4b4b4{
Te6edf3TopBarActionsTb4b4b4(Te6edf3ourNode Tff7b72= Te6edf3ourNodeTb4b4b4, Te6edf3showNodeChip Tff7b72= Te6edf3showNodeChipTb4b4b4, Te6edf3actions Tff7b72= Te6edf3actionsTb4b4b4, Te6edf3onClickChip Tff7b72= Te6edf3onClickChipTb4b4b4)
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
T8b949e/** Reads [LocalEventBranding] to show event artwork (with tap → snackbar), or the default Meshtastic logo. */
Tf0883e@Composable
Tff7b72private Tff7b72fun Td2a8ffEventAwareBrandingTb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3eventEdition Tff7b72= Te6edf3LocalEventBrandingTb4b4b4.Te6edf3current
Tff7b72val Te6edf3iconRes Tff7b72= Te6edf3eventEditionTff7b72?.Te6edf3iconRes
Tff7b72if Tb4b4b4(Te6edf3iconRes Tff7b72!Tff7b72= Tff7b72nullTb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3scope Tff7b72= Te6edf3rememberCoroutineScopeTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3snackbarManager Tff7b72= Te6edf3koinInjectTff7b72<Te6edf3SnackbarManagerTff7b72>Tb4b4b4(Tb4b4b4)
Te6edf3ImageTb4b4b4(
Te6edf3painter Tff7b72= Te6edf3painterResourceTb4b4b4(Te6edf3iconResTb4b4b4)Tb4b4b4,
Te6edf3contentDescription Tff7b72= Te6edf3eventEditionTb4b4b4.Te6edf3nameTb4b4b4,
Te6edf3contentScale Tff7b72= Te6edf3ContentScaleTb4b4b4.Te6edf3FitTb4b4b4,
Te6edf3modifier Tff7b72=
Te6edf3ModifierTb4b4b4.Te6edf3sizeTb4b4b4(T79c0ff3T79c0ff2.Te6edf3dpTb4b4b4)Tb4b4b4.Te6edf3clipTb4b4b4(Te6edf3CircleShapeTb4b4b4)Tb4b4b4.Te6edf3clickableTb4b4b4(Te6edf3role Tff7b72= Te6edf3RoleTb4b4b4.Te6edf3ButtonTb4b4b4) Tb4b4b4{
Te6edf3scopeTb4b4b4.Te6edf3launch Tb4b4b4{
Tff7b72val Te6edf3message Tff7b72= Te6edf3getStringTb4b4b4(Te6edf3eventEditionTb4b4b4.Te6edf3welcomeMessageResTb4b4b4)
Te6edf3snackbarManagerTb4b4b4.Te6edf3showSnackbarTb4b4b4(Te6edf3messageTb4b4b4)
Tb4b4b4}
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4} Tff7b72else Tb4b4b4{
Te6edf3IconTb4b4b4(Te6edf3imageVector Tff7b72= Te6edf3vectorResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3drawableTb4b4b4.Te6edf3ic_meshtasticTb4b4b4)Tb4b4b4, Te6edf3contentDescription Tff7b72= Tff7b72nullTb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tf0883e@Composable
Tff7b72private Tff7b72fun Td2a8ffTopBarActionsTb4b4b4(
Te6edf3ourNodeTb4b4b4: Te6edf3Node?Tb4b4b4,
Te6edf3showNodeChipTb4b4b4: Tffa657BooleanTb4b4b4,
Te6edf3actionsTb4b4b4: Tf0883e@Composable Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3onClickChipTb4b4b4: Tb4b4b4(Te6edf3NodeTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3AnimatedVisibilityTb4b4b4(Te6edf3visible Tff7b72= Te6edf3showNodeChipTb4b4b4, Te6edf3enter Tff7b72= Te6edf3fadeInTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3exit Tff7b72= Te6edf3fadeOutTb4b4b4(Tb4b4b4)Tb4b4b4) Tb4b4b4{
Te6edf3ourNodeTff7b72?.Te6edf3let Tb4b4b4{ Te6edf3node Tff7b72-Tff7b72>
Te6edf3NodeChipTb4b4b4(Te6edf3modifier Tff7b72= Te6edf3ModifierTb4b4b4.Te6edf3paddingTb4b4b4(Te6edf3horizontal Tff7b72= T79c0ff1T79c0ff6.Te6edf3dpTb4b4b4)Tb4b4b4, Te6edf3node Tff7b72= Te6edf3nodeTb4b4b4, Te6edf3onClick Tff7b72= Te6edf3onClickChipTb4b4b4)
Tb4b4b4}
Tb4b4b4}
Te6edf3actionsTb4b4b4(Tb4b4b4)
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.06s